<?php 

    /* Author : IronLady */
?>
<li><div id="language-header" class="m-btn-group group-plain">
    <a class="m-btn-plain dropdown-toggle small drp" data-toggle="dropdown" href="#"><?php echo zen_image(DIR_WS_LANGUAGES .  $languages->fields['directory'] . '/images/' . $languages->fields['image'], $languages->fields['name']) . '&nbsp;' . $languages->fields['name']; ?> <span class="icon-angle-down"></span></a>
<?php    
  $lng_cnt = 0;
  $content = '<ul class="m-dropdown-menu">';
  while (list($key, $value) = each($lng->catalog_languages)) {
    $content .= '<li><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . zen_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '&nbsp;' . $value['name'] . '</a></li>';
    $lng_cnt ++;
  }
  $content .= '</ul>';
?>
<?php echo $content; ?>
</div></li>